//////////////////////////////////////////////////////////////////////////////////
//
//	AvaMods Random SkyMap
//		- Version 1.0
//		- 04.03.2008
//		- diamond-optic
//
//////////////////////////////////////////////////////////////////////////////////
//
// Information:
//
//    - Selects a random skymap for the AvaMods servers
//
//////////////////////////////////////////////////////////////////////////////////
//
// Changelog:
//
//    - ##.##.2006 Version 0.2beta
//  	  Removed Engine - requires at least AMXX 1.75
//
//    - 07.22.2006 Version 0.3beta
//  	  Added 'dod_stuka' skymap
//	  Moved server_cmd after precache
//
//    - 07.24.2006 Version 0.4beta
//  	  Added 'flyaway' skymap
//	  Added 'majestic256_' skymap
//	  Added 'nomansland' skymap
//
//    - 11.30.2007 Version 1.0
//  	  Official Public Release
//
//    - 04.03.2008 Version 1.0 (re-release)
//	  Public CVAR
//
//////////////////////////////////////////////////////////////////////////////////


#include <amxmodx>

new VERSION[] = "1.0"
new SVERSION[] = "v1.0 - by diamond-optic (www.AvaMods.com)"

public plugin_init()
{
	register_plugin("avamods Random Skymap",VERSION,"diamond-optic")
	register_cvar("avamods_random_skymap_stats",SVERSION,FCVAR_SERVER|FCVAR_SPONLY)
}

public plugin_precache()
{	
	switch(random_num(1, 15))
		{
		case 1:	{
			precache_generic("gfx/env/ava1rt.tga")
			precache_generic("gfx/env/ava1lf.tga")
			precache_generic("gfx/env/ava1ft.tga")
			precache_generic("gfx/env/ava1dn.tga")
			precache_generic("gfx/env/ava1bk.tga")
			precache_generic("gfx/env/ava1up.tga")
			server_cmd("sv_skyname ava1")
			}
		case 2: {
			precache_generic("gfx/env/ava2rt.tga")
			precache_generic("gfx/env/ava2lf.tga")
			precache_generic("gfx/env/ava2ft.tga")
			precache_generic("gfx/env/ava2dn.tga")
			precache_generic("gfx/env/ava2bk.tga")
			precache_generic("gfx/env/ava2up.tga")
			server_cmd("sv_skyname ava2")
			}
		case 3: {
			precache_generic("gfx/env/tropdayrt.tga")
			precache_generic("gfx/env/tropdaylf.tga")
			precache_generic("gfx/env/tropdayft.tga")
			precache_generic("gfx/env/tropdaydn.tga")
			precache_generic("gfx/env/tropdaybk.tga")
			precache_generic("gfx/env/tropdayup.tga")
			server_cmd("sv_skyname tropday")
			}
		case 4: {
			precache_generic("gfx/env/dmcwrt.tga")
			precache_generic("gfx/env/dmcwlf.tga")
			precache_generic("gfx/env/dmcwft.tga")
			precache_generic("gfx/env/dmcwdn.tga")
			precache_generic("gfx/env/dmcwbk.tga")
			precache_generic("gfx/env/dmcwup.tga")
			server_cmd("sv_skyname dmcw")
			}
		case 5: {
			precache_generic("gfx/env/tropseaduskrt.tga")
			precache_generic("gfx/env/tropseadusklf.tga")
			precache_generic("gfx/env/tropseaduskft.tga")
			precache_generic("gfx/env/tropseaduskdn.tga")
			precache_generic("gfx/env/tropseaduskbk.tga")
			precache_generic("gfx/env/tropseaduskup.tga")
			server_cmd("sv_skyname tropseadusk")
			}
		case 6: {
			precache_generic("gfx/env/tropicalrt.tga")
			precache_generic("gfx/env/tropicallf.tga")
			precache_generic("gfx/env/tropicalft.tga")
			precache_generic("gfx/env/tropicaldn.tga")
			precache_generic("gfx/env/tropicalbk.tga")
			precache_generic("gfx/env/tropicalup.tga")
			server_cmd("sv_skyname tropical")
			}
		case 7: {
			precache_generic("gfx/env/sunbeams_rt.tga")
			precache_generic("gfx/env/sunbeams_lf.tga")
			precache_generic("gfx/env/sunbeams_ft.tga")
			precache_generic("gfx/env/sunbeams_dn.tga")
			precache_generic("gfx/env/sunbeams_bk.tga")
			precache_generic("gfx/env/sunbeams_up.tga")
			server_cmd("sv_skyname sunbeams_")
			}
		case 8: {
			precache_generic("gfx/env/grnplsntrt.tga")
			precache_generic("gfx/env/grnplsntlf.tga")
			precache_generic("gfx/env/grnplsntft.tga")
			precache_generic("gfx/env/grnplsntdn.tga")
			precache_generic("gfx/env/grnplsntbk.tga")
			precache_generic("gfx/env/grnplsntup.tga")
			server_cmd("sv_skyname grnplsnt")
			}
		case 9: {
			precache_generic("gfx/env/killertomatort.tga")
			precache_generic("gfx/env/killertomatolf.tga")
			precache_generic("gfx/env/killertomatoft.tga")
			precache_generic("gfx/env/killertomatodn.tga")
			precache_generic("gfx/env/killertomatobk.tga")
			precache_generic("gfx/env/killertomatoup.tga")
			server_cmd("sv_skyname killertomato")
			}
		case 10:{
			precache_generic("gfx/env/kraftstoffrt.tga")
			precache_generic("gfx/env/kraftstofflf.tga")
			precache_generic("gfx/env/kraftstoffft.tga")
			precache_generic("gfx/env/kraftstoffdn.tga")
			precache_generic("gfx/env/kraftstoffbk.tga")
			precache_generic("gfx/env/kraftstoffup.tga")
			server_cmd("sv_skyname kraftstoff")
			}
		case 11:{
			precache_generic("gfx/env/morningdewrt.tga")
			precache_generic("gfx/env/morningdewlf.tga")
			precache_generic("gfx/env/morningdewft.tga")
			precache_generic("gfx/env/morningdewdn.tga")
			precache_generic("gfx/env/morningdewbk.tga")
			precache_generic("gfx/env/morningdewup.tga")
			server_cmd("sv_skyname morningdew")
			}
		case 12:{
			precache_generic("gfx/env/dod_stukart.tga")
			precache_generic("gfx/env/dod_stukalf.tga")
			precache_generic("gfx/env/dod_stukaft.tga")
			precache_generic("gfx/env/dod_stukadn.tga")
			precache_generic("gfx/env/dod_stukabk.tga")
			precache_generic("gfx/env/dod_stukaup.tga")
			server_cmd("sv_skyname dod_stuka")
			}
		case 13:{
			precache_generic("gfx/env/flyawayrt.tga")
			precache_generic("gfx/env/flyawaylf.tga")
			precache_generic("gfx/env/flyawayft.tga")
			precache_generic("gfx/env/flyawaydn.tga")
			precache_generic("gfx/env/flyawaybk.tga")
			precache_generic("gfx/env/flyawayup.tga")
			server_cmd("sv_skyname flyaway")
			}
		case 14:{
			precache_generic("gfx/env/majestic256_rt.tga")
			precache_generic("gfx/env/majestic256_lf.tga")
			precache_generic("gfx/env/majestic256_ft.tga")
			precache_generic("gfx/env/majestic256_dn.tga")
			precache_generic("gfx/env/majestic256_bk.tga")
			precache_generic("gfx/env/majestic256_up.tga")
			server_cmd("sv_skyname majestic256_")
			}
		case 15:{
			precache_generic("gfx/env/nomanslandrt.tga")
			precache_generic("gfx/env/nomanslandlf.tga")
			precache_generic("gfx/env/nomanslandft.tga")
			precache_generic("gfx/env/nomanslanddn.tga")
			precache_generic("gfx/env/nomanslandbk.tga")
			precache_generic("gfx/env/nomanslandup.tga")
			server_cmd("sv_skyname nomansland")
			}
		}
}